<template>
  <div>
    <formRender
      :schema="schema"
      :form-data="formData"
      @on-change="change"
      @on-validate="validate"
    />
  </div>
</template>

<script setup>
import {defineEmits, defineProps, reactive, toRefs, ref} from 'vue';
import FormRender from 'vue3-form-render';
import 'vue3-form-render/lib/vue3-form-render.css';

const props = defineProps({
  propertiesOriginal: {
    type: Object,
    required: true
  },
  formDataOriginal: {
    type: Object,
    required: true
  }
})

const schema = ref({
  type: 'object',
  properties: props.propertiesOriginal,
})
let formData = {
  string: '',
  select1: 'c'
}

const change = (v) => {
  formData = v
  console.log(formData);
}
const validate = (v) => {
  console.log(v);
}

</script>
